#!/usr/bin/env python3
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

# mypy: disable-error-code=var-annotated

checkname = "varnish"


mock_item_state = {
    "cache": {
        "varnish.cache_miss": (0.0, 5688),
        "varnish.cache_hit": (0.0, 3679),
        "varnish.cache_hitpass": (0.0, 0.0),
    },
    "client": {
        "varnish.client_drop": (0.0, 0.0),
        "varnish.client_req": (0.0, 22399444),
        "varnish.client_conn": (0.0, 13688122),
        "varnish.client_drop_late": (0.0, 0.0),
    },
    "backend": {
        "varnish.backend_busy": (0.0, 0.0),
        "varnish.backend_unhealthy": (0.0, 0.0),
        "varnish.backend_req": (0.0, 15543010),
        "varnish.backend_recycle": (0.0, 15535904),
        "varnish.backend_retry": (0.0, 46),
        "varnish.backend_fail": (0.0, 0),
        "varnish.backend_toolate": (0.0, 6235),
        "varnish.backend_conn": (0.0, 6870905),
        "varnish.backend_reuse": (0.0, 15529663),
    },
    "fetch": {
        "varnish.fetch_head": (0.0, 2027),
        "varnish.fetch_length": (0.0, 262229),
        "varnish.fetch_chunked": (0.0, 15036092),
        "varnish.fetch_eof": (0.0, 0),
        "varnish.fetch_bad": (0.0, 0),
        "varnish.fetch_close": (0.0, 0),
        "varnish.fetch_oldhttp": (0.0, 0),
        "varnish.fetch_zero": (0.0, 0),
        "varnish.fetch_failed": (0.0, 0),
        "varnish.fetch_1xx": (0.0, 0),
        "varnish.fetch_204": (0.0, 0),
        "varnish.fetch_304": (0.0, 242538),
    },
    "esi": {
        "varnish.esi_warnings": (0.0, 0),
        "varnish.esi_errors": (0.0, 0),
    },
    "objects": {
        "varnish.n_object": (0.0, 6),
        "varnish.n_vampireobject": (0.0, 0),
        "varnish.n_expired": (0.0, 5680),
        "varnish.n_lru_nuked": (0.0, 0),
        "varnish.n_lru_moved": (0.0, 1031),
    },
    "worker": {
        "varnish.n_wrk": (0.0, 1000),
        "varnish.n_wrk_create": (0.0, 1000),
        "varnish.n_wrk_failed": (0.0, 0),
        "varnish.n_wrk_max": (0.0, 893),
        "varnish.n_wrk_lqueue": (0.0, 0),
        "varnish.n_wrk_queued": (0.0, 21),
        "varnish.n_wrk_drop": (0.0, 0),
    },
}


info = [
    ["client_conn", "13688122", "4.41", "Client", "connections", "accepted"],
    ["client_drop", "0", "0.00", "Connection", "dropped,", "no", "sess/wrk"],
    ["client_req", "22399444", "7.21", "Client", "requests", "received"],
    ["cache_hit", "3679", "0.00", "Cache", "hits"],
    ["cache_hitpass", "0", "0.00", "Cache", "hits", "for", "pass"],
    ["cache_miss", "5688", "0.00", "Cache", "misses"],
    ["backend_conn", "6870905", "2.21", "Backend", "conn.", "success"],
    ["backend_unhealthy", "0", "0.00", "Backend", "conn.", "not", "attempted"],
    ["backend_busy", "0", "0.00", "Backend", "conn.", "too", "many"],
    ["backend_fail", "0", "0.00", "Backend", "conn.", "failures"],
    ["backend_reuse", "15529663", "5.00", "Backend", "conn.", "reuses"],
    ["backend_toolate", "6235", "0.00", "Backend", "conn.", "was", "closed"],
    ["backend_recycle", "15535904", "5.00", "Backend", "conn.", "recycles"],
    ["backend_retry", "46", "0.00", "Backend", "conn.", "retry"],
    ["fetch_head", "2027", "0.00", "Fetch", "head"],
    ["fetch_length", "262229", "0.08", "Fetch", "with", "Length"],
    ["fetch_chunked", "15036092", "4.84", "Fetch", "chunked"],
    ["fetch_eof", "0", "0.00", "Fetch", "EOF"],
    ["fetch_bad", "0", "0.00", "Fetch", "had", "bad", "headers"],
    ["fetch_close", "0", "0.00", "Fetch", "wanted", "close"],
    ["fetch_oldhttp", "0", "0.00", "Fetch", "pre", "HTTP/1.1", "closed"],
    ["fetch_zero", "0", "0.00", "Fetch", "zero", "len"],
    ["fetch_failed", "0", "0.00", "Fetch", "failed"],
    ["fetch_1xx", "0", "0.00", "Fetch", "no", "body", "(1xx)"],
    ["fetch_204", "0", "0.00", "Fetch", "no", "body", "(204)"],
    ["fetch_304", "242538", "0.08", "Fetch", "no", "body", "(304)"],
    ["n_sess_mem", "100000", ".", "N", "struct", "sess_mem"],
    ["n_sess", "205478", ".", "N", "struct", "sess"],
    ["n_object", "6", ".", "N", "struct", "object"],
    ["n_vampireobject", "0", ".", "N", "unresurrected", "objects"],
    ["n_objectcore", "103", ".", "N", "struct", "objectcore"],
    ["n_objecthead", "106", ".", "N", "struct", "objecthead"],
    ["n_waitinglist", "1656", ".", "N", "struct", "waitinglist"],
    ["n_vbc", "63", ".", "N", "struct", "vbc"],
    ["n_wrk", "1000", ".", "N", "worker", "threads"],
    ["n_wrk_create", "1000", "0.00", "N", "worker", "threads", "created"],
    ["n_wrk_failed", "0", "0.00", "N", "worker", "threads", "not", "created"],
    ["n_wrk_max", "893", "0.00", "N", "worker", "threads", "limited"],
    ["n_wrk_lqueue", "0", "0.00", "work", "request", "queue", "length"],
    ["n_wrk_queued", "21", "0.00", "N", "queued", "work", "requests"],
    ["n_wrk_drop", "0", "0.00", "N", "dropped", "work", "requests"],
    ["n_backend", "2", ".", "N", "backends"],
    ["n_expired", "5680", ".", "N", "expired", "objects"],
    ["n_lru_nuked", "0", ".", "N", "LRU", "nuked", "objects"],
    ["n_lru_moved", "1031", ".", "N", "LRU", "moved", "objects"],
    ["losthdr", "0", "0.00", "HTTP", "header", "overflows"],
    ["n_objsendfile", "0", "0.00", "Objects", "sent", "with", "sendfile"],
    ["n_objwrite", "15304594", "4.93", "Objects", "sent", "with", "write"],
    ["n_objoverflow", "0", "0.00", "Objects", "overflowing", "workspace"],
    ["s_sess", "13688192", "4.41", "Total", "Sessions"],
    ["s_req", "22399444", "7.21", "Total", "Requests"],
    ["s_pipe", "6857383", "2.21", "Total", "pipe"],
    ["s_pass", "15537563", "5.00", "Total", "pass"],
    ["s_fetch", "15536463", "5.00", "Total", "fetch"],
    ["s_hdrbytes", "2623668048", "844.77", "Total", "header", "bytes"],
    ["s_bodybytes", "64230617131", "20680.97", "Total", "body", "bytes"],
    ["sess_closed", "13155380", "4.24", "Session", "Closed"],
    ["sess_pipeline", "0", "0.00", "Session", "Pipeline"],
    ["sess_readahead", "0", "0.00", "Session", "Read", "Ahead"],
    ["sess_linger", "15527441", "5.00", "Session", "Linger"],
    ["sess_herd", "14213158", "4.58", "Session", "herd"],
    ["shm_records", "1455329990", "468.59", "SHM", "records"],
    ["shm_writes", "117704314", "37.90", "SHM", "writes"],
    ["shm_flushes", "0", "0.00", "SHM", "flushes", "due", "to", "overflow"],
    ["shm_cont", "1081722", "0.35", "SHM", "MTX", "contention"],
    ["shm_cycles", "646", "0.00", "SHM", "cycles", "through", "buffer"],
    ["sms_nreq", "1919", "0.00", "SMS", "allocator", "requests"],
    ["sms_nobj", "0", ".", "SMS", "outstanding", "allocations"],
    ["sms_nbytes", "0", ".", "SMS", "outstanding", "bytes"],
    ["sms_balloc", "708111", ".", "SMS", "bytes", "allocated"],
    ["sms_bfree", "708111", ".", "SMS", "bytes", "freed"],
    ["backend_req", "15543010", "5.00", "Backend", "requests", "made"],
    ["n_vcl", "1", "0.00", "N", "vcl", "total"],
    ["n_vcl_avail", "1", "0.00", "N", "vcl", "available"],
    ["n_vcl_discard", "0", "0.00", "N", "vcl", "discarded"],
    ["n_ban", "1", ".", "N", "total", "active", "bans"],
    ["n_ban_add", "1", "0.00", "N", "new", "bans", "added"],
    ["n_ban_retire", "0", "0.00", "N", "old", "bans", "deleted"],
    ["n_ban_obj_test", "0", "0.00", "N", "objects", "tested"],
    ["n_ban_re_test", "0", "0.00", "N", "regexps", "tested", "against"],
    ["n_ban_dups", "0", "0.00", "N", "duplicate", "bans", "removed"],
    ["hcb_nolock", "9357", "0.00", "HCB", "Lookups", "without", "lock"],
    ["hcb_lock", "5680", "0.00", "HCB", "Lookups", "with", "lock"],
    ["hcb_insert", "5536", "0.00", "HCB", "Inserts"],
    ["esi_errors", "0", "0.00", "ESI", "parse", "errors", "(unlock)"],
    ["esi_warnings", "0", "0.00", "ESI", "parse", "warnings", "(unlock)"],
    ["accept_fail", "0", "0.00", "Accept", "failures"],
    ["client_drop_late", "0", "0.00", "Connection", "dropped", "late"],
    ["dir_dns_lookups", "0", "0.00", "DNS", "director", "lookups"],
    ["dir_dns_failed", "0", "0.00", "DNS", "director", "failed", "lookups"],
    ["dir_dns_hit", "0", "0.00", "DNS", "director", "cached", "lookups", "hit"],
    ["dir_dns_cache_full", "0", "0.00", "DNS", "director", "full", "dnscache"],
    ["vmods", "1", ".", "Loaded", "VMODs"],
    ["n_gzip", "0", "0.00", "Gzip", "operations"],
    ["n_gunzip", "82397", "0.03", "Gunzip", "operations"],
    ["LCK.sms.creat", "1", "0.00", "Created", "locks"],
    ["LCK.sms.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.sms.locks", "5757", "0.00", "Lock", "Operations"],
    ["LCK.sms.colls", "0", "0.00", "Collisions"],
    ["LCK.smp.creat", "0", "0.00", "Created", "locks"],
    ["LCK.smp.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.smp.locks", "0", "0.00", "Lock", "Operations"],
    ["LCK.smp.colls", "0", "0.00", "Collisions"],
    ["LCK.sma.creat", "2", "0.00", "Created", "locks"],
    ["LCK.sma.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.sma.locks", "76789246", "24.72", "Lock", "Operations"],
    ["LCK.sma.colls", "0", "0.00", "Collisions"],
    ["LCK.smf.creat", "0", "0.00", "Created", "locks"],
    ["LCK.smf.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.smf.locks", "0", "0.00", "Lock", "Operations"],
    ["LCK.smf.colls", "0", "0.00", "Collisions"],
    ["LCK.hsl.creat", "0", "0.00", "Created", "locks"],
    ["LCK.hsl.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.hsl.locks", "0", "0.00", "Lock", "Operations"],
    ["LCK.hsl.colls", "0", "0.00", "Collisions"],
    ["LCK.hcb.creat", "1", "0.00", "Created", "locks"],
    ["LCK.hcb.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.hcb.locks", "28465", "0.01", "Lock", "Operations"],
    ["LCK.hcb.colls", "0", "0.00", "Collisions"],
    ["LCK.hcl.creat", "0", "0.00", "Created", "locks"],
    ["LCK.hcl.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.hcl.locks", "0", "0.00", "Lock", "Operations"],
    ["LCK.hcl.colls", "0", "0.00", "Collisions"],
    ["LCK.vcl.creat", "1", "0.00", "Created", "locks"],
    ["LCK.vcl.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.vcl.locks", "2851", "0.00", "Lock", "Operations"],
    ["LCK.vcl.colls", "0", "0.00", "Collisions"],
    ["LCK.stat.creat", "1", "0.00", "Created", "locks"],
    ["LCK.stat.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.stat.locks", "100000", "0.03", "Lock", "Operations"],
    ["LCK.stat.colls", "0", "0.00", "Collisions"],
    ["LCK.sessmem.creat", "1", "0.00", "Created", "locks"],
    ["LCK.sessmem.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.sessmem.locks", "13788830", "4.44", "Lock", "Operations"],
    ["LCK.sessmem.colls", "0", "0.00", "Collisions"],
    ["LCK.wstat.creat", "1", "0.00", "Created", "locks"],
    ["LCK.wstat.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.wstat.locks", "9610420", "3.09", "Lock", "Operations"],
    ["LCK.wstat.colls", "0", "0.00", "Collisions"],
    ["LCK.herder.creat", "1", "0.00", "Created", "locks"],
    ["LCK.herder.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.herder.locks", "1", "0.00", "Lock", "Operations"],
    ["LCK.herder.colls", "0", "0.00", "Collisions"],
    ["LCK.wq.creat", "2", "0.00", "Created", "locks"],
    ["LCK.wq.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.wq.locks", "60935122", "19.62", "Lock", "Operations"],
    ["LCK.wq.colls", "0", "0.00", "Collisions"],
    ["LCK.objhdr.creat", "5630", "0.00", "Created", "locks"],
    ["LCK.objhdr.destroy", "5528", "0.00", "Destroyed", "locks"],
    ["LCK.objhdr.locks", "50493", "0.02", "Lock", "Operations"],
    ["LCK.objhdr.colls", "0", "0.00", "Collisions"],
    ["LCK.exp.creat", "1", "0.00", "Created", "locks"],
    ["LCK.exp.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.exp.locks", "3116883", "1.00", "Lock", "Operations"],
    ["LCK.exp.colls", "0", "0.00", "Collisions"],
    ["LCK.lru.creat", "2", "0.00", "Created", "locks"],
    ["LCK.lru.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.lru.locks", "5686", "0.00", "Lock", "Operations"],
    ["LCK.lru.colls", "0", "0.00", "Collisions"],
    ["LCK.cli.creat", "1", "0.00", "Created", "locks"],
    ["LCK.cli.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.cli.locks", "1034607", "0.33", "Lock", "Operations"],
    ["LCK.cli.colls", "0", "0.00", "Collisions"],
    ["LCK.ban.creat", "1", "0.00", "Created", "locks"],
    ["LCK.ban.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.ban.locks", "3116888", "1.00", "Lock", "Operations"],
    ["LCK.ban.colls", "0", "0.00", "Collisions"],
    ["LCK.vbp.creat", "1", "0.00", "Created", "locks"],
    ["LCK.vbp.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.vbp.locks", "0", "0.00", "Lock", "Operations"],
    ["LCK.vbp.colls", "0", "0.00", "Collisions"],
    ["LCK.vbe.creat", "1", "0.00", "Created", "locks"],
    ["LCK.vbe.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.vbe.locks", "13742087", "4.42", "Lock", "Operations"],
    ["LCK.vbe.colls", "0", "0.00", "Collisions"],
    ["LCK.backend.creat", "2", "0.00", "Created", "locks"],
    ["LCK.backend.destroy", "0", "0.00", "Destroyed", "locks"],
    ["LCK.backend.locks", "51690378", "16.64", "Lock", "Operations"],
    ["LCK.backend.colls", "0", "0.00", "Collisions"],
    ["SMA.s0.c_req", "13217", "0.00", "Allocator", "requests"],
    ["SMA.s0.c_fail", "0", "0.00", "Allocator", "failures"],
    ["SMA.s0.c_bytes", "960020137", "309.11", "Bytes", "allocated"],
    ["SMA.s0.c_freed", "959606425", "308.97", "Bytes", "freed"],
    ["SMA.s0.g_alloc", "14", ".", "Allocations", "outstanding"],
    ["SMA.s0.g_bytes", "413712", ".", "Bytes", "outstanding"],
    ["SMA.s0.g_space", "268021744", ".", "Bytes", "available"],
    ["SMA.Transient.c_req", "30824441", "9.92", "Allocator", "requests"],
    ["SMA.Transient.c_fail", "0", "0.00", "Allocator", "failures"],
    ["SMA.Transient.c_bytes", "2050011605312", "660062.73", "Bytes", "allocated"],
    ["SMA.Transient.c_freed", "2050011605312", "660062.73", "Bytes", "freed"],
    ["SMA.Transient.g_alloc", "0", ".", "Allocations", "outstanding"],
    ["SMA.Transient.g_bytes", "0", ".", "Bytes", "outstanding"],
    ["SMA.Transient.g_space", "0", ".", "Bytes", "available"],
    ["VBE.default(127.0.0.1,,81).vcls", "1", ".", "VCL", "references"],
    ["VBE.default(127.0.0.1,,81).happy", "0", ".", "Happy", "health", "probes"],
    ["VBE.stepstone(X.X.X.X,,80).vcls", "1", ".", "VCL", "references"],
    ["VBE.stepstone(X.X.X.X,,80).happy", "0", ".", "Happy", "health", "probes"],
]

discovery = {
    "": [],
    "backend": [(None, {})],
    "backend_success_ratio": [(None, {})],
    "cache": [(None, {})],
    "cache_hit_ratio": [(None, {})],
    "client": [(None, {})],
    "esi": [(None, {})],
    "fetch": [(None, {})],
    "objects": [(None, {})],
    "worker": [(None, {})],
    "worker_thread_ratio": [(None, {})],
}

checks = {
    "backend": [
        (
            None,
            {},
            [
                (
                    0,
                    "0.0 conn. too many/s",
                    [("varnish_backend_busy_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 conn. not attempted/s",
                    [("varnish_backend_unhealthy_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 requests made/s",
                    [("varnish_backend_req_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 conn. recycles/s",
                    [("varnish_backend_recycle_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 conn. retry/s",
                    [("varnish_backend_retry_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 conn. failures/s",
                    [("varnish_backend_fail_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 conn. was closed/s",
                    [("varnish_backend_toolate_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 conn. success/s",
                    [("varnish_backend_conn_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 conn. reuses/s",
                    [("varnish_backend_reuse_rate", 0.0, None, None, None, None)],
                ),
            ],
        )
    ],
    "backend_success_ratio": [
        (
            None,
            {"levels_lower": (70.0, 60.0)},
            [(0, "100.00%", [("varnish_backend_success_ratio", 100.0, None, None, None, None)])],
        )
    ],
    "cache": [
        (
            None,
            {},
            [
                (0, "0.0 misses/s", [("varnish_cache_miss_rate", 0.0, None, None, None, None)]),
                (0, "0.0 hits/s", [("varnish_cache_hit_rate", 0.0, None, None, None, None)]),
                (
                    0,
                    "0.0 hits for pass/s",
                    [("varnish_cache_hitpass_rate", 0.0, None, None, None, None)],
                ),
            ],
        )
    ],
    "cache_hit_ratio": [
        (
            None,
            {"levels_lower": (70.0, 60.0)},
            [
                (
                    2,
                    "39.28% (warn/crit below 70.00%/60.00%)",
                    [("cache_hit_ratio", 39.2761823422654, None, None, None, None)],
                )
            ],
        )
    ],
    "client": [
        (
            None,
            {},
            [
                (
                    0,
                    "0.0 Connection dropped, no sess wrk/s",
                    [("varnish_client_drop_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 requests received/s",
                    [("varnish_client_req_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 connections accepted/s",
                    [("varnish_client_conn_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 Connection dropped late/s",
                    [("varnish_client_drop_late_rate", 0.0, None, None, None, None)],
                ),
            ],
        )
    ],
    "esi": [
        (
            None,
            {"errors": (1.0, 2.0)},
            [
                (
                    0,
                    "0.0 parse errors (unlock)/s",
                    [("varnish_esi_errors_rate", 0.0, 1.0, 2.0, None, None)],
                ),
                (
                    0,
                    "0.0 parse warnings (unlock)/s",
                    [("varnish_esi_warnings_rate", 0.0, None, None, None, None)],
                ),
            ],
        )
    ],
    "fetch": [
        (
            None,
            {},
            [
                (
                    0,
                    "0.0 pre HTTP 1.1 closed/s",
                    [("varnish_fetch_oldhttp_rate", 0.0, None, None, None, None)],
                ),
                (0, "0.0 head/s", [("varnish_fetch_head_rate", 0.0, None, None, None, None)]),
                (0, "0.0 EOF/s", [("varnish_fetch_eof_rate", 0.0, None, None, None, None)]),
                (0, "0.0 zero len/s", [("varnish_fetch_zero_rate", 0.0, None, None, None, None)]),
                (
                    0,
                    "0.0 no body (304)/s",
                    [("varnish_fetch_304_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 with Length/s",
                    [("varnish_fetch_length_rate", 0.0, None, None, None, None)],
                ),
                (0, "0.0 failed/s", [("varnish_fetch_failed_rate", 0.0, None, None, None, None)]),
                (
                    0,
                    "0.0 had bad headers/s",
                    [("varnish_fetch_bad_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 wanted close/s",
                    [("varnish_fetch_close_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 no body (1xx)/s",
                    [("varnish_fetch_1xx_rate", 0.0, None, None, None, None)],
                ),
                (0, "0.0 chunked/s", [("varnish_fetch_chunked_rate", 0.0, None, None, None, None)]),
                (
                    0,
                    "0.0 no body (204)/s",
                    [("varnish_fetch_204_rate", 0.0, None, None, None, None)],
                ),
            ],
        )
    ],
    "objects": [
        (
            None,
            {},
            [
                (
                    0,
                    "0.0 expired objects/s",
                    [("varnish_objects_expired_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 LRU nuked objects/s",
                    [("varnish_objects_lru_nuked_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 LRU moved objects/s",
                    [("varnish_objects_lru_moved_rate", 0.0, None, None, None, None)],
                ),
            ],
        )
    ],
    "worker": [
        (
            None,
            {},
            [
                (
                    0,
                    "0.0 work request queue length/s",
                    [("varnish_worker_lqueue_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 worker threads created/s",
                    [("varnish_worker_create_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 dropped work requests/s",
                    [("varnish_worker_drop_rate", 0.0, None, None, None, None)],
                ),
                (0, "0.0 worker threads/s", [("varnish_worker_rate", 0.0, None, None, None, None)]),
                (
                    0,
                    "0.0 worker threads not created/s",
                    [("varnish_worker_failed_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 queued work requests/s",
                    [("varnish_worker_queued_rate", 0.0, None, None, None, None)],
                ),
                (
                    0,
                    "0.0 worker threads limited/s",
                    [("varnish_worker_max_rate", 0.0, None, None, None, None)],
                ),
            ],
        )
    ],
    "worker_thread_ratio": [
        (
            None,
            {"levels_lower": (70.0, 60.0)},
            [(0, "100.00%", [("varnish_worker_thread_ratio", 100.0, None, None, None, None)])],
        )
    ],
}
